//logs.js
var util = require('../../utils/util.js')
var app = getApp()
Page({
  data: {
    motto: 'Hello World',
    userInfo: {},
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
    showAuthBtn: true,
  },
  // 事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: ''
    })
  },
  onLoad: function () {
    var that = this;
    // 查看是否授权
    wx.getSetting({
      success(res) {
        if (res.authSetting['scope.userInfo'] && that.data.userInfo.nickname) {
          that.setData({
            showAuthBtn: false
          })
        }
      }
    })
  },
  bindGetUserInfo(e) {
    var that = this;
    console.log(e.detail)
    that.setData({
      showAuthBtn: false,
      userInfo: e.detail.userInfo
    })
  },
})